<?php
namespace app\test\Validate;
use think\Validate;

class admin extends Validate{

    protected $rule = [
        'username|用户名' => 'require|min:2',
        'password|密码' => 'require|min:5|confirm:repassword',
        'email|邮箱' => 'require',
        'captcha|验证码' => 'captcha'
    ];

    protected $message = [
        'username.require' => '用户名不能为空！',
        'username.min' => '用户名长度不能少于2位！',
        'password.require' => '密码不能为空！',
        'password.min' => '密码长度不能少于5位！',
        'password.confirm' => '两次密码不一致！',
        'email.require' => '邮箱不能为空！',
    ];

    protected $scene = [
        'login'  =>  ['username','password'=>'require'],
    ];
}

